package com.elsa.common.configure;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

import com.elsa.common.handler.ElsaAccessDeniedHandler;
import com.elsa.common.handler.ElsaAuthExceptionEntryPoint;
/**
 * @projectName：elsa-common
 * @typeName：ElsaAuthExceptionConfigure
 * @author：cos
 * @date：2021年5月11日
 * @version
 * @desc：@Enable模块驱动
 */
public class ElsaAuthExceptionConfigure {
    @Bean
    @ConditionalOnMissingBean(name = "accessDeniedHandler")
    public ElsaAccessDeniedHandler accessDeniedHandler() {
        return new ElsaAccessDeniedHandler();
    }

    @Bean
    @ConditionalOnMissingBean(name = "authenticationEntryPoint")
    public ElsaAuthExceptionEntryPoint authenticationEntryPoint() {
        return new ElsaAuthExceptionEntryPoint();
    }
}
